package xin.qixia.robot.ding.config;

import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.context.annotation.Bean;
import xin.qixia.robot.core.RobotMessageDispatcher;
import xin.qixia.robot.core.config.RobotClientFactoryAutoConfiguration;
import xin.qixia.robot.ding.client.DingTalkClient;
import xin.qixia.robot.ding.convert.DingTalkMessageConvert;

/**
 * @author wangkaixin
 * @date 2025/5/28 10:02
 */
@AutoConfigureBefore(RobotClientFactoryAutoConfiguration.class)
public class DingTalkClientAutoConfiguration {

    @Bean
    public DingTalkClient dingTalkClient(RobotMessageDispatcher dispatcher) {
        return new DingTalkClient(dispatcher, new DingTalkMessageConvert());
    }
}
